import requests


headers = {
    "accept": "*/*",
    "accept-language": "zh-CN,zh;q=0.9",
    "cache-control": "no-cache",
    "pragma": "no-cache",
    "priority": "u=1, i",
    "referer": "https://movie.douban.com/",
    "sec-ch-ua": "\"Google Chrome\";v=\"131\", \"Chromium\";v=\"131\", \"Not_A Brand\";v=\"24\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"Windows\"",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "same-origin",
    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",
    "x-requested-with": "XMLHttpRequest"
}
cookies = {
    "bid": "hxC8R3aCgWI",
    "_ga_PRH9EWN86K": "GS1.2.1724673194.1.0.1724673194.0.0.0",
    "douban-fav-remind": "1",
    "ll": "\"118237\"",
    "__yadk_uid": "BQ38kVLAa5XsTVspdkCij6h17a5LmPFE",
    "_pk_id.100001.4cf6": "f618ea569ac8b942.1724738124.",
    "_vwo_uuid_v2": "D6DBBC47FA8794F48EF917BC35363E7CB|d7fefa51a4ce24069846d66752fe652c",
    "_ga": "GA1.1.1355979370.1724671376",
    "_ga_Y4GN1R87RG": "GS1.1.1724750237.2.0.1724750243.0.0.0",
    "viewed": "\"36808795_36897362_36858240_36878790_36991441_36790192_36783021_36911739_36897630_36930293\"",
    "_ga_RXNMP372GL": "GS1.1.1729854222.5.1.1729857898.60.0.0",
    "__utmc": "223695111",
    "ap_v": "0,6.0",
    "_pk_ref.100001.4cf6": "%5B%22%22%2C%22%22%2C1733225458%2C%22https%3A%2F%2Fwww.douban.com%2F%22%5D",
    "_pk_ses.100001.4cf6": "1",
    "__utma": "223695111.1355979370.1724671376.1733119068.1733225458.5",
    "__utmb": "223695111.0.10.1733225458",
    "__utmz": "223695111.1733225458.5.4.utmcsr=douban.com|utmccn=(referral)|utmcmd=referral|utmcct=/"
}
url = "https://movie.douban.com/j/search_subjects"
page = -50
while True:
    page += 50
    params = {
        "type": "movie",
        "tag": "热门",
        "page_limit": "50",
        "page_start":f"{page}"
    }
    response = requests.get(url, headers=headers, cookies=cookies, params=params)

    res = response.json()
    print(res)